* Load data for all experiments


* ------------------------------ TABLE: ATTRITION BY TREATMENT ------------------------------

	eststo clear 

	* 

	use "${pathdata_summary}/BaselineAttrition.dta", clear
	eststo study1: reg completed neutral mixed, r
	estadd ysumm
	
	use "${pathdata_summary}/AssociationAttrition.dta", clear
	eststo study2: reg completed prompt, r
	estadd ysumm
	
	use "${pathdata_summary}/ProductAttrition.dta", clear
	eststo study4: reg completed product1 product6, r
	estadd ysumm
	
	use "${pathdata_summary}/DecoyAttrition.dta", clear
	eststo study5: reg completed decoy_story decoy_stat, r
	estadd ysumm
	
	use "${pathdata_summary}/FormatAttrition.dta", clear
	eststo study7: reg completed belief_percent info_percent, r
	estadd ysumm

	
	use "${pathdata_summary}/CuetargetsimAttrition.dta", clear
	eststo study8: reg completed jones eatery, r
	estadd ysumm
	
	use "${pathdata_summary}/CuenontargetAttrition.dta", clear
	gen high_similarity = (treatment == "treatment")
	eststo study9: reg completed high_similarity, r
	estadd ysumm

	
	


	


***************************************************
**** Step 3: Write out to table *******************
***************************************************

/* SOME COMMENTS ON THE ESTTAB CODE

The table didn't format nicely. This might be due to some bug or maybe my old STATA version.
I had to manually implement /end{tabular} and a '}' so that the Latex code actually compiles.
If my code does not work for you: maybe you can check whether it automatically writes /end{tabular} and '}' into the Latex file.
Then, the postfoot is redundant and you can delete it :)

*/



	
	esttab study1 study8 study9 study5 study4 study7 study2 using "${pathout_summary}/tables/tableA12.tex", ///
		booktabs nonotes replace label nomtitles ///
		keep(neutral mixed prompt product1 product6 decoy_story decoy_stat belief_percent info_percent eatery jones high_similarity) order(neutral mixed eatery jones high_similarity decoy_story decoy_stat product1 product6 belief_percent info_percent prompt ) coeflabels(neutral "Neutral Story" mixed "Mixed Story" prompt "Prompt" product1 "1-Product" product6 "6-Products" decoy_story "Decoy: Story" decoy_stat "Decoy: Statistic" belief_percent "Belief: \%" info_percent "Info: \%" eatery "An Eatery" jones "Mr. Jones" high_similarity "High Similarity" _cons "Control Mean") ///
		se(2) b(a2) stats(ymean N p r2, fmt(2 0 2) label("Mean Completed" "Observations" "p(Joint Null)" "R^2")) star(* 0.10 ** 0.05 *** 0.01) ///
		prehead("{\begin{tabular}{l*{7}{c}}\toprule\toprule&\multicolumn{7}{c}{\textit{Dependent variable:}}\\[.1cm] &\multicolumn{9}{c}{Wave 2 Completion} \\ \cmidrule(lr){2-10} \\ \textit{Experiment:} &\multicolumn{1}{c}{Baseline} &\multicolumn{1}{c}{Cue-Target Sim} &\multicolumn{1}{c}{Cue-Non-Target Sim} &\multicolumn{1}{c}{Decoy} &\multicolumn{1}{c}{Product} &\multicolumn{1}{c}{Format} &\multicolumn{1}{c}{Association} \\")



